﻿Imports System.Data.SqlClient
Module modKetNoi
    ' Lưu trữ chuỗi kết nối
    Public strConnectionString As String = ""
    Public aryConfig As New System.Collections.Hashtable
    Public Function checkIsLocked(ByVal Thang As String, ByVal nam As String) As Boolean
        Dim strSql As String = "Select count(*) from KhoaSo where Thang = @Thang and Nam = @Nam"
        Dim myConn As New SqlConnection(modKetNoi.strConnectionString)
        Dim myComm As New SqlCommand
        Dim result As Boolean = False
        Try
            myConn.Open()
            myComm.CommandText = strSql
            myComm.Parameters.AddWithValue("@Thang", Thang)
            myComm.Parameters.AddWithValue("@Nam", nam)
            myComm.Connection = myConn
            If myComm.ExecuteScalar() > 0 Then
                result = True
            End If
        Catch ex As Exception

        End Try
        myConn.Close()
        myConn.Dispose()
        Return result
    End Function
End Module
